package com.ybkj.daijia.server.mapper;

import com.ybkj.daijia.server.model.ChargeStartDistance;
import com.ybkj.daijia.server.model.ChargeWeightDistance;
import java.util.List;
import org.apache.ibatis.annotations.Param;

/**
 * Created by mqs on 15/3/6.
 */
public interface ChargeStartDistanceMapper {

    /**
     * 保存梯度收费详细
     *
     * @param record
     * @return
     */
    int insertRecord(ChargeStartDistance record);

    /**
     * 批量保存梯度收费详细
     *
     * @param records
     * @return
     */
    int batchInsertRecord(List<ChargeStartDistance> records);

    /**
     * 根据主键查询梯度收费详细
     *
     * @param id
     * @return
     */
    ChargeStartDistance selectByPrimaryKey(Long id);

    /**
     * 根据一组主键查询梯度收费详细
     *
     * @param ids
     * @return
     */
    List<ChargeStartDistance> selectByIdIn(Long[] ids);

    /**
     * 根据主键删除梯度收费详细
     *
     * @param id
     * @return
     */
    int deleteByPrimaryKey(Long id);

    /**
     * 根据收费时间段删除梯度收费详细
     *
     * @param chargeStartTimeId
     * @return
     */
    int deleteByChargeStartTime(
        @Param("chargeStartTimeId") Long chargeStartTimeId);

    /**
     * 根据主键修改梯度收费详细
     *
     * @param record
     * @return
     */
    int updateByPrimaryKey(ChargeStartDistance record);

    /**
     * 根据区域删除所有里程计费
     *
     * @param areaId
     * @return
     */
    int deleteByArea(Long areaId);

    void batchInsertWeightRecord(List<ChargeWeightDistance> distancelist);

    void deleteByChargeStartWeight(@Param("chargeStartWeightId") Long chargeStartWeightId);

    void deleteByAreaWeight(Long areaId);

}
